
#include <iostream>

#include "Tictactoe.h"


using std::cout;
using std::cin;


int main()
{
    Tictactoe game;
    int pos;

	cout << "Tic-Tac-Toe:\n\n";
	cout << "0|1|2\n";
	cout << "3|4|5\n";
	cout << "6|7|8\n\n";

    while( !game.hasGameEnded( game.getBoard() ) )
    {
        // Prints player turn
        if( game.getTurn() == 1 )
        {
            cout << "Player 1 to play: ";

            // Reads position
            cin >> pos;
        }
        else
        {
            cout << "Thinking...\n";
            pos = game.minimax( game.getBoard() );
        }

        // Player plays
        game.playerPlays( game.getTurn(), pos );

        // Show board
        game.printBoard( game.getBoard() );
    }
    
    return 0;
}

